#!/usr/bin/env xonsh

p"~/.xonshrc".exists() && source ~/.xonshrc

from os.path import dirname,abspath,join

DIR = dirname(dirname(abspath(__file__)))

CI = join(dirname(DIR),'ci')

x64 = 'x64'
arm64 = 'arm64'

for (platform,arch_li) in (
  (
    'win32',
    (
      x64,
    )
  ),
  (
    'darwin',
    (
      x64,
      arm64
    )
  )
):

  for arch in arch_li:
    cd @(DIR)

    for key,i in (
      ('platform',platform),
      ('arch',arch)
    ):

      export = f'export default "{i}"'
      echo @(export) > @(DIR)/src/config/@(key).mjs

    ./build.sh

    cd @(CI)/dist
    git add @(platform)-@(arch)

@(DIR)/script/platform_arch.sh
@(CI)/ver.push.sh
